import $axios from '../utils/request';
// 查询列表数据
export const getCompanyPage = (params) => {
  return $axios({
    url: '/company/page',
    method: 'get',
    params
  })
}

// 删除数据接口
export const deleteCompany = (ids) => {
  return $axios({
    url: '/company',
    method: 'delete',
    params: { ids }
  })
}

// 修改数据接口
export const editCompany = (params) => {
  return $axios({
    url: '/company',
    method: 'put',
    data: { ...params }
  })
}

// 新增数据接口
export const addCompany = (params) => {
  return $axios({
    url: '/company',
    method: 'post',
    data: { ...params }
  })
}

// 查询详情接口
export const queryCompanyById = (id) => {
  return $axios({
    url: `/company/${id}`,
    method: 'get'
  })
}
// 查模型列表的接口
export const queryCompanyList = (params) => {
  return $axios({
    url: '/company/listCompanies',
    method: 'get',
    params
  })
}

// 批量起售禁售
export const companyStatusByStatus = (params) => {
  return $axios({
    url: `/company/status/${params.status}`,
    method: 'post',
    params: { ids: params.ids }
  })
}
